//
//  TabBarViewController.m
//  SnacksOfChina
//
//  Created by qianfeng on 15/9/14.
//  Copyright (c) 2015年 AD Wang. All rights reserved.
//

#import "TabBarViewController.h"
#import "BaseViewController.h"

@interface TabBarViewController ()

@end

@implementation TabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createViewControllers];
}

#pragma mark - 创建子视图控制器
- (void)createViewControllers
{
    NSArray * vcNames = @[@"HotViewController",@"FoundViewController",@"LikeViewController",@"ShakeViewController",@"MoreViewController"];
    NSArray * titles = @[@"推荐",@"发现",@"收藏",@"摇一摇",@"更多"];
    NSArray * images = @[@"hot@2x",@"found@2x",@"like@2x",@"shake@2x",@"more@2x"];
    NSMutableArray * vcArr = [[NSMutableArray alloc]init];
    for (NSInteger i = 0; i < vcNames.count; i ++) {
        Class vcClass = NSClassFromString(vcNames[i]);
        BaseViewController * vc = [[vcClass alloc]init];
        UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:vc];
        nav.tabBarItem.title = titles[i];
        nav.tabBarItem.image = [UIImage imageNamed:images[i]];
        [vcArr addObject:nav];
    }
    self.viewControllers = vcArr;
    /**
     *  tabbar图标被选中后的颜色
     */
    self.tabBar.tintColor = [UIColor redColor];
    
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}








@end
